import java.io.IOException;
import java.io.OutputStream;

public class Escrita implements Runnable 
    {
        OutputStream out;
        
        public Escrita ( OutputStream out )
        {
            this.out = out;
        }
        
        public void run ()
        {
            try
            {                
                byte c = 1;
                while ( true )
                {
                    this.out.write(c);
                    System.out.println("mandou "+c);
                }                
            }
            catch ( IOException e )
            {
                e.printStackTrace();
            }            
        }
    }